<?php
	include_once("login.php");
	
	$conn = new mysqli($host,$user,$passwd, $database)
	or die("SQL connect error: ".mysqli_connect_error());
	
	$userId = $_REQUEST["userId"];
	$query = "SELECT name, categoryId FROM category WHERE userId=$userId";
	//print $query;
	$result = mysqli_query($conn, $query);
	while($row = mysqli_fetch_array($result))
	{
		echo $row['categoryId'] . "\n";
		echo $row['name'] . "\n";
	}
	mysqli_close($conn);
?>